<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
if($_RQ['op']=='list'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>array('1','2','3','4'));

	if(!empty($_RQ['mid'])){
		$params['mid']=trim($_RQ['mid']);
		$return['params']['mid']=$_RQ['mid'];
	}
	//$fields=array('id','name','mobile','status','stop','gender','createtime','carid','idcard','bx','address','cid');
    $orderby='createtime desc';
	$total='';
	$return['list']=pdo_getslice('jy_jdk_member_logs',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	foreach($return['list'] as &$v){
		$v['createtime']=date('Y-m-d H:m:s',$v['createtime']);
		}
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'收款管理'),
		),
		'list'=>array('data'=>'list','edit'=>false,'delete_one'=>false,'deleteall'=>false,'list'=>array(
			array('name'=>'mid','title'=>'会员id','type'=>'string'),
			array('name'=>'nickname','title'=>'会员昵称','type'=>'string'),
			array('name'=>'avatar','title'=>'头像','type'=>'image'),
			array('name'=>'mobile','title'=>'手机号','type'=>'string'),
			array('name'=>'money','title'=>'金额/积分','type'=>'string'),
			array('name'=>'remark','title'=>'备注','type'=>'string'),
			array('name'=>'type','title'=>'类型','type'=>'radio','options'=>'type'),
			array('name'=>'status','title'=>'状态','type'=>'radio','options'=>'status'),
			
				
		)),
		'search'=>array(
			array('name'=>'mid','width'=>15,'title'=>'会员id','type'=>'string'),
			//array('name'=>'mobile','title'=>'手机号','type'=>'string'),			
		)
	);
	$return['htmls']=$htmls;
	$return['status']=array('1'=>'已完成','0'=>'待付款');
	$return['type']=array('1'=>'积分','2'=>'佣金','3'=>'补贴','4'=>'充值');

	exi($return);
	}
if($_RQ['op']=='finish'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>1,'status'=>array('1','2','3','4'));
    if(!empty($_RQ['name'])){
		$params['name like']='%'.trim($_RQ['name']).'%';
		$return['params']['name']=$_RQ['name'];
	}
	if(!empty($_RQ['mid'])){
		$params['mid']=trim($_RQ['mid']);
		$return['params']['mid']=$_RQ['mid'];
	}
	//$fields=array('id','name','mobile','status','stop','gender','createtime','carid','idcard','bx','address','cid');
    $orderby='createtime desc';
	$total='';
	$return['list']=pdo_getslice('jy_jdk_member_logs',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	foreach($return['list'] as &$v){
		$v['createtime']=date('Y-m-d H:m:s',$v['createtime']);
		}
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'收款管理'),
		),
		'list'=>array('data'=>'list','edit'=>false,'delete_one'=>false,'deleteall'=>false,'list'=>array(
			array('name'=>'mid','title'=>'会员id','type'=>'string'),
			array('name'=>'nickname','title'=>'会员昵称','type'=>'string'),
			array('name'=>'avatar','title'=>'头像','type'=>'image'),
			array('name'=>'mobile','title'=>'手机号','type'=>'string'),
			array('name'=>'money','title'=>'金额/积分','type'=>'string'),
			array('name'=>'remark','title'=>'备注','type'=>'string'),
			array('name'=>'status','title'=>'状态','type'=>'radio','options'=>'status'),
			
				
		),
		
		),
		'search'=>array(
			array('name'=>'mid','width'=>15,'title'=>'会员id','type'=>'string'),
			//array('name'=>'mobile','title'=>'手机号','type'=>'string'),			
		)
	);
	$return['htmls']=$htmls;
	$return['status']=array('1'=>'已完成','0'=>'待付款');
	$return['type']=array('1'=>'积分','2'=>'佣金','3'=>'补贴','4'=>'充值');

	exi($return);
	}
if($_RQ['op']=='wait'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>0,'status'=>array('1','2','3','4'));
    if(!empty($_RQ['name'])){
		$params['name like']='%'.trim($_RQ['name']).'%';
		$return['params']['name']=$_RQ['name'];
	}
	if(!empty($_RQ['mid'])){
		$params['mid']=trim($_RQ['mid']);
		$return['params']['mid']=$_RQ['mid'];
	}
	//$fields=array('id','name','mobile','status','stop','gender','createtime','carid','idcard','bx','address','cid');
    $orderby='createtime desc';
	$total='';
	$return['list']=pdo_getslice('jy_jdk_member_logs',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	foreach($return['list'] as &$v){
		$v['createtime']=date('Y-m-d H:m:s',$v['createtime']);
		}
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'收款管理'),
		),
		'list'=>array('data'=>'list','edit'=>false,'delete_one'=>false,'deleteall'=>false,'list'=>array(
			array('name'=>'mid','title'=>'会员id','type'=>'string'),
			array('name'=>'nickname','title'=>'会员昵称','type'=>'string'),
			array('name'=>'avatar','title'=>'头像','type'=>'image'),
			array('name'=>'mobile','title'=>'手机号','type'=>'string'),
			array('name'=>'money','title'=>'金额/积分','type'=>'string'),
			array('name'=>'remark','title'=>'备注','type'=>'string'),
			array('name'=>'status','title'=>'状态','type'=>'radio','options'=>'status'),
			
				
		)),
		'search'=>array(
			array('name'=>'mid','width'=>15,'title'=>'会员id','type'=>'string'),
			//array('name'=>'mobile','title'=>'手机号','type'=>'string'),			
		)
	);
	$return['htmls']=$htmls;
	$return['status']=array('1'=>'已完成','0'=>'待付款');
	$return['type']=array('1'=>'积分','2'=>'佣金','3'=>'补贴','4'=>'充值');

	exi($return);
	}


?>